package CreationModel.PrototypeModel;

/**
 * @author 王蕾 [wanglei_dev@cyou-inc.com]
 * @date 2017-12-05 15:04:00
 */
public class ResumeDeepCopy implements Cloneable {
    /**
     * 姓名
     */
    private String name;

    /**
     * 性别
     */
    private String sex;

    /**
     * 年龄
     */
    private String age;

    /**
     * 工作经历
     */
    private WorkExperience workExperience;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }



    public void display(){
        System.out.println("姓名:"+name+","+sex+",年龄:"+age);
        System.out.println("工作经历："+workExperience.getTimeArea()+" "+workExperience.getCompany());

    }

    /**
     * 获取 工作经历
     * @return workExperience 工作经历
     */
    public WorkExperience getWorkExperience() {
        return this.workExperience;
    }

    /**
     * 设置 工作经历
     * @param workExperience 工作经历
     */
    public void setWorkExperience(WorkExperience workExperience) {
        this.workExperience = workExperience;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {

       ResumeDeepCopy resumeDeepCopy = (ResumeDeepCopy)super.clone();
       WorkExperience workExperience = (WorkExperience) resumeDeepCopy.getWorkExperience().clone();
       resumeDeepCopy.setWorkExperience(workExperience);
       return resumeDeepCopy;
    }

    public void setUserInfo(String name, String age, String sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
    }


}
